import request from '@/utils/request'
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 添加子组件
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取部门详情数据
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 修改部门详情数据
export function updateDepartmentDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 删除部门
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
